https://docs.microsoft.com/en-us/bot-framework/nodejs/bot-builder-nodejs-handle-conversation-events
bot.on('conversationUpdate', function (message) {
if (message.membersAdded && message.membersAdded.length > 0) {
// Say hello
var isGroup = message.address.conversation.isGroup;
var txt = isGroup ? "Hello everyone!" : "Hello...";
var reply = new builder.Message()
.address(message.address)
.text(txt);
bot.send(reply);
} else if (message.membersRemoved) {
// See if bot was removed
var botId = message.address.bot.id;
for (var i = 0; i < message.membersRemoved.length; i++) {
if (message.membersRemoved[i].id === botId) {
// Say goodbye
var reply = new builder.Message()
.address(message.address)
.text("Goodbye");
bot.send(reply);
break;
}
}
}
});
event去年也沒有,但那個時候line就有了,我記得我自已硬加的,不然很難搞,不過現在有這些定義好的event可以接,就方便很多了。